/*
 * @Description: 安徽省厅超图配置
 * @Author: wangqian
 * @LastEditors: wangqian
 * @Date: 2021-05-05 16:48:12
 * @LastEditTime: 2021-06-11 18:02:00
 */

var resolutions = [
  0.010986328125000005,
  0.0054931640624999905,
  0.0027465820312500074,
  0.0013732910156250013,
  6.866455078124993e-4,
  3.433227539062509e-4,
  1.7166137695312497e-4,
  8.583068847656249e-5,
  4.291534423828124e-5,
  2.145767211914062e-5,
  1.072883605957031e-5,
  5.364418029785166e-6,
  2.682209014892583e-6,
];
var matrixIds = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
var info = {
  layer: 'pgisvecv1',
  matrixSet: 'Custom_pgisvecv1',
  style: 'default',
  format: 'image/png',
};

let config = {
  defaultJd: '117.95', //默认经度
  defaultWd: '31.75', //默认纬度
  center: [117.95, 31.75],
  defaultZoom: 8, //地图默认显示层级
  minZoom: 0, //最层级
  maxZoom: 12, //最小层级
  projection: 'EPSG:4326',
  tileGrid: {
    origin: [114.877479, 34.65111],
    resolutions: resolutions,
    matrixIds: matrixIds,
    extent: [114.88, 29.4, 119.65, 34.65],
  },
  url: 'http://53.1.49.190/iserver/services/map-pgisvec/wmts100', //安徽省厅超图SuperMapWMTS服务xml文档
};

export var ahLayer = new ol.layer.Tile({
  source: new ol.source.WMTS({
    attributions: false,
    url: config.url,
    layer: info.layer,
    style: info.style,
    matrixSet: info.matrixSet,
    format: info.format,
    wrapX: true,
    tileGrid: new ol.tilegrid.WMTS(config.tileGrid),
  }),
});
var projection = ol.proj.get('EPSG:4326');
export var ahView = new ol.View({
  projection: projection,
  center: config.center,
  zoom: config.defaultZoom,
});
